Many imaging devices are equipped with functionalities of automatic focusing, where a focusing process is performed without any intervention by an operator of a device. Typical imaging devices include cameras, video recorders and other devices with image taking or recording capabilities, such as smart mobile phones.
Taking a camera as an example, when a photograph is being taken, a first step is to focus on an object being photographed. Some cameras are equipped with automatic focusing functionality. When automatically focusing on an object in photographing or video recording, one image frame can be divided into three image regions: main imaging region, secondary imaging region and background imaging region. The main purpose for focusing is to make the image within the main imaging region as clear as possible.
In a focusing process, a lens can be regarded as a convex lens. For a certain focus value of a zoom lens or for a fixed-focus lens, a focus distance is fixed. The relationship of an object distance, an image distance and an focus distance can be represented as follows:
                                          1            u                    +                      1            v                          =                  1          f                                    Equation        ⁢                                  ⁢                  (          1          )                    wherein, u refers to the object distance, v refers to the image distance and f refers to the focus distance. We can see from the above descriptions, when the focus distance and object distance are fixed, the main purpose for focusing is to change the image distance in order for it to satisfy Equation (1).
For a specific image, space depths for its main imaging region, its secondary imaging region and its background region are different, i.e. the object distances for those three are different. Therefore, at a specific time and with a certain focus distance, the image distance can only be adjusted to satisfy Equation (1) with respect to the image distance of only one region.
In order to obtain a picture with a clear main imaging region, the main imaging region should be correctly found and should be precisely located within a proper dimensioned focusing window, so as to let it focus precisely.
In existing technologies, popular methods for selecting image focusing windows include center selection approach and multi-region selection approach. Between the two, center selection approach is to take a small region of M*N pixels in the center of an image frame as a focusing window. Multi-region selection approach is to take a plurality of representative regions as image focusing windows, e.g. regions with M*N pixels centered with four dividing points along a horizontal axis or a vertical axis. Multi-region selection approach can also take regions with M*N pixels centered with four dividing points along two diagonal lines as image focusing windows.
Several issues exist in such typical systems when an imaging device is focusing an image. First of all, the main imaging region does not always falls into one of the above described regions. In some circumstances, the main imaging region is located in the above described regions and the purpose of precise focusing can be achieved in those circumstances. However, when the main imaging region is not within the above described regions, the above described approaches for focusing window are unable to guaranty a picture with clear main imaging region. Second, when the area of a focusing window is greater the main imaging region, the existing approaches not only increase the amount of calculations, they can also deteriorate the final results of focusing. The reason for the deterioration is because they cause the focusing evaluation curves not sharp enough at the transition or joint places.
Therefore, there is a need for a system and method for automatically selecting image focusing windows, which can control the amount of calculations and guaranty a sharp focusing evolution curve.
It should be noted that the figures are not drawn to scale and that elements of similar structures or functions are generally represented by like reference numerals for illustrative purposes throughout the figures. It also should be noted that the figures are only intended to facilitate the description of the preferred embodiments. The figures do not illustrate every aspect of the described embodiments and do not limit the scope of the present disclosure.